/**
 * Copyright (C) 2015-2018 IQIYI
 * All rights reserved.
 *
 * Author     : 王海斌
 * E-mail     : wanghaibin@qiyi.com
 * Version    :
 * Date       : Fri 15 Nov 2019 05:31:46 PM CST
 * Destription:
 */

#include <acl-lib/acl/lib_acl.h>
#include <acl-lib/acl_cpp/lib_acl.hpp>

void test_decode_uri()
{
    std::string uri="GET /query?path=%2Fssd%2Fwww%2Fvideos%2Fv0%2F20190603%2F5e%2Ff4%2F3b60867064cd93634000911d78f8c854.265ts&type=0 HTTP/1.1  Connection: Keep-Alive  Accept-Encoding: gzip  Host: 127.0.0.1:7001  ";

    char * info = acl_url_decode(uri.c_str(), NULL);
    printf("xxx=%s\n", info);
    printf("uri=%s\n", uri.c_str());
    acl_myfree(info);
}

void test_split()
{
    acl::string data="__1234__xxxxxxx";
    std::vector<acl::string>& vec = data.split2("__");
    printf("size=%zd\n", vec.size());
    for(size_t i=0; i<vec.size(); ++i) {
        printf("vec[%d]=%s\n",i, vec[i].c_str());
    }
}
int main(int , char *[])
{
    test_split();
    return 0;
}
